CREATE TABLE `SRAnalytics`.`MsgLiveAtmVol` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying tickerKey (stock or product group) that this option expiration is associated with',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying tickerKey (stock or product group) that this option expiration is associated with',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying tickerKey (stock or product group) that this option expiration is associated with',
`uPrc` DOUBLE NOT NULL DEFAULT 0 COMMENT 'effective underlier price',
`years` FLOAT NOT NULL DEFAULT 0 COMMENT 'SR years to expiry metric',
`rate` FLOAT NOT NULL DEFAULT 0 COMMENT 'average expected interest rate to expiry (SR global rate curve)',
`ddiv` FLOAT NOT NULL DEFAULT 0 COMMENT '(expected) cumulative discrete dividend $ amounts prior to expiration (if any)',
`ddivPv` FLOAT NOT NULL DEFAULT 0 COMMENT '(expected) cumulative npv of discrete dividend $ amounts prior to expiration (SR global rate curve) (if any)',
`ddivSource` ENUM('None','Announced','Forecast') NOT NULL DEFAULT 'None' COMMENT 'Forecast if any of the dividends prior to expiry are forecast rather than announced',
`atmVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm vol (xAxis = 0)',
`atmEMA` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm vol exp moving average (half-life ~ 30 seconds)',
`uPrcRatio` DOUBLE NOT NULL DEFAULT 0 COMMENT 'uPrc = uPrcDriver * uPrcRatio (when priceType = Future); uPrc = uPrcDriver (when priceType = Equity)',
`uPrcRatioEMA` DOUBLE NOT NULL DEFAULT 0 COMMENT 'time smoothed implied uPrcRatio (half-life ~ 30 seconds)',
`sdiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'stock dividend (borrow rate) (derived from call/put balance when priceType=Stock; =rate otherwise)',
`sdivEMA` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv exp moving average (half-life ~ 30 seconds)',
`minCPAdjVal` DOUBLE NOT NULL DEFAULT 0 COMMENT 'minimum cpAdjVal (sdiv or uPrcRatio)',
`maxCPAdjVal` DOUBLE NOT NULL DEFAULT 0 COMMENT 'minimum cpAdjVal (sdiv or uPrcRatio)',
`cpAdjType` ENUM('None','SDiv','UPrcRatio') NOT NULL DEFAULT 'None' COMMENT 'adjustment used to align calls/puts',
`priceType` ENUM('None','Equity','Future') NOT NULL DEFAULT 'None' COMMENT '[Equity] has independent uPrc and rate with sdiv derived from call/put balance; [Future] has sdiv = rate with uPrc'' derived from call/put balance',
`uPrcDriverKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key',
`uPrcDriverKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key',
`uPrcDriverKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlier driver key',
`uPrcDriverKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key type (stock or future)',
`uPrcDriver` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier driver (mid-market)',
`axisFUPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'forward underlier price; also at-the-money (xAxis = 0) synthetic strike',
`synSpot` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Synthetic spot price (market-derived spot when the underlying is not a traded instrument)',
`vWidth` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm volatility market width (estimated from near expiries)',
`numAtmStrikes` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`tradeableStatus` ENUM('None','OK','SurfaceErr','LowCCnt','LowPCnt','FitPrcErr','BidAskMiss','LowCounter','DefaultSkew','SessionMiss','BaseErr','SwitchDelay','WideMktV','WideMktP','WideUMkt','UWidthEma','CCntEma','PCntEma','VWidthEma','PWidthEma','Closed') NOT NULL DEFAULT 'None' COMMENT 'indicates whether the surface is currently tradeable or not (all server surface integrity checks pass)',
`surfaceResult` ENUM('None','OK','Exception','AxisError','MarketClosed','NoBaseSurface','NoFutUPrc','NoStkUPrc','NullStock','UnknownFKey','ZeroYrs','MarketHalted','WideUMkt','BaseSurface','NotEnoughStrikes','KernelIVErr','KernelCPErr','ProxyError','BadAtmVol','BadSDiv','BadUOff','NoBaseAtmVol','NoDriverStock','NoDriverFuture') NOT NULL DEFAULT 'None',
`netTimestamp` BIGINT NOT NULL DEFAULT 0 COMMENT 'most recent unix timestamp (all option quotes)',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='LiveAtmVol records are computed and publish continuously during trading hours';